<template>
  <!-- 顶部菜单栏 -->
  <TopMenu @to-father="getTopMenuMsg"></TopMenu>
  <!-- 左侧菜单栏 -->
  <sideMenu></sideMenu>
  <!--  -->
  <!-- 地图组件 -->
  <div id="mapPage" class="mapPage">
    <Map> </Map>
  </div>
  <!--单车轨迹管理框侧边栏-->
  <BikeTraceManage ref="isShowBikeTrace"></BikeTraceManage>
  <!--路网管理侧边栏-->
  <RoadNetManage ref="isShowRoadNet"></RoadNetManage>
  <!--交通轨迹量-->
  <TraceCountsManage ref="isShowTraceCounts"></TraceCountsManage>
  <!--热门停车点位 -->
  <HotParkPointManage @to-father="getShowStreetPhotosMsg" ref="isShowHotParkPoint"></HotParkPointManage>
  <!--OD点位-->
  <ODPiontManage ref="isShowODPoint"></ODPiontManage>
  <router-view name="NotFound"></router-view>

  <!--街景抽屉-->
  <StreetPhoto style="display: flow" ref="isShowStreetPhoto"></StreetPhoto>

  <!--单车调度 -->
  <AreaSmartDispatch></AreaSmartDispatch>
  <CitySmartDIspatch></CitySmartDIspatch>
</template>

<script lang="ts" setup>
import store from "../store/index.js";
import axios from 'axios';
import Map from '../pages/Map.vue'
import TopMenu from "../components/TopMenu.vue";
import SideMenu from "../components/SideMenu.vue";
import BikeTraceManage,{ExposeType as bikeTrace} from "../components/BikeTraceManage.vue"
import RoadNetManage,{ExposeType as RoadNet} from "../components/RoadNetManage.vue"
import TraceCountsManage,{ExposeType as TraceCounts} from "../components/TraceCountsManage.vue";
import {ref} from 'vue'
import HotParkPointManage,{ExposeType as HotParkPoint} from "../components/HotParkPointManage.vue";
import ODPiontManage ,{ExposeType as ODPoint}from "../components/ODPiontManage.vue";
import StreetPhoto,{ExposeType as StreetPht} from "../components/StreetPhoto.vue";
import AreaSmartDispatch from "../components/AreaSmartDispatch.vue";
import CitySmartDIspatch from "../components/CitySmartDIspatch.vue";

const isShowBikeTrace = ref<bikeTrace | null>(null)
const isShowRoadNet = ref<RoadNet | null>(null)
const isShowTraceCounts=ref<TraceCounts | null>(null)
const isShowHotParkPoint=ref<HotParkPoint| null>(null)
const isShowODPoint=ref<ODPoint | null>(null)
//接受子组件TopMenu传递事件isShowBikeTrace=true的事件 并传递给BikeTraceManage
const getTopMenuMsg = (val1:boolean,
                       val2:boolean,
                       val3:boolean,
                       val4:boolean,
                       val5:boolean) => {
  if(isShowBikeTrace.value) {
    isShowBikeTrace.value.getIsShowBikeTraceMsg(val1)
  }
  if(isShowRoadNet.value){
    isShowRoadNet.value.getIsShowRoadNetMsg(val2)
  }
  if(isShowTraceCounts.value){
    isShowTraceCounts.value.getIsShowTraceCountsMsg(val3)
  }
  if(isShowHotParkPoint.value){
    isShowHotParkPoint.value.getIsShowHopParkPointMsg(val4)
  }
  if(isShowODPoint.value){
    isShowODPoint.value.getIsShowODPointMsg(val5)
  }
  console.log(val1,val2,val3,val4,val5)
}


const isShowStreetPhoto=ref<StreetPht | null>(null)
const getShowStreetPhotosMsg = (isShow:boolean,x:number,y:number) => {
  console.log(isShow,isShowStreetPhoto.value)
  if(isShowStreetPhoto.value){
    isShowStreetPhoto.value.getIsShowStreetPhotoMsg(isShow,x,y)
    console.log(isShow,x,y)
  }
}
</script>



<style scoped>

</style>
